package common

import (
	"github.com/flipped-aurora/gin-vue-admin/server/global"
	"github.com/flipped-aurora/gin-vue-admin/server/model/avatar"
	avatar3 "github.com/flipped-aurora/gin-vue-admin/server/service/avatar"
	"go.uber.org/zap"
)

func CreateAvatarD(userID uint, position string) error {
	var avatar avatar.Avatar
	temp := int(userID)
	avatar.Avatar_user = &temp
	avatar.Avatar_position = position
	if err := avatar3.CreateAvatarServ(avatar); err != nil {
		global.GVA_LOG.Error("创建失败!", zap.Error(err))
		return err
	} else {
		return nil
	}
}
